<!DOCTYPE html>
<html>
<head lang="zh-cmn-Hans">
    <meta charset="UTF-8">
    <title>编辑器</title>
    <link rel="stylesheet" type="text/css" href="plugins/simditor-2.1.5/styles/simditor.css"/>

    <script type="text/javascript" src="plugins/simditor-2.1.5/scripts/jquery.min.js"></script>
    <script type="text/javascript" src="plugins/simditor-2.1.5/scripts/module.js"></script>
    <script type="text/javascript" src="plugins/simditor-2.1.5/scripts/hotkeys.js"></script>
    <script type="text/javascript" src="plugins/simditor-2.1.5/scripts/uploader.js"></script>
    <script type="text/javascript" src="plugins/simditor-2.1.5/scripts/simditor.js"></script>

</head>
<script type="text/javascript">

    function content() {
        alert($('#editor').val());
    }

    $(function () {
        var editor = new Simditor({
            textarea: $('#editor'),
            toolbar: ['title', 'bold', 'italic', 'underline', 'strikethrough', 'color', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|', 'link', 'image', 'hr', '|', 'indent', 'outdent', '|', 'source'],
            upload: {
                url: 'upload.action',
                params: null,
                fileKey: 'upload_file',
                connectionCount: 3,
                leaveConfirm: '正在上传文件，如果离开上传会自动取消'
            }
        });
//    var editor = new Simditor({
//        textarea: $('#editor')
//    });
    });

    //    (function() {
    //        $(function() {
    //            var editor, mobileToolbar, toolbar;
    //            toolbar = ['title', 'bold', 'italic', 'underline', 'strikethrough', 'color', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|', 'link', 'image', 'hr', '|', 'indent', 'outdent', '|', 'source'];
    ////            mobileToolbar = ["bold", "underline", "strikethrough", "color", "ul", "ol"];
    ////            if (mobilecheck()) {
    ////                toolbar = mobileToolbar;
    ////            }
    //            return editor = new Simditor({
    //                textarea: $('#txt-content'),
    //                placeholder: '这里输入文字...',
    //                toolbar: toolbar,
    //                pasteImage: true,
    //                defaultImage: 'assets/images/image.png',
    //                upload: location.search === '?upload' ? {
    //                    url: '/upload'
    //                } : false
    //            });
    //        });
    //
    //    }).call(this);

</script>
<body>

<textarea id="editor" placeholder="这里输入内容" autofocus>

</textarea>

<p>
    <input onclick="content();" type="button" value="show"/>
</p>

</body>
</html>
